﻿<%@ Page Title="" Language="C#" MasterPageFile="~/App_MasterPages/MainMasterPage.master"
    AutoEventWireup="true" CodeFile="Gallery.aspx.cs" Inherits="Admin_Gallery" %>

<asp:Content ID="Content1" ContentPlaceHolderID="Main_HeaderContentPlaceHolder" runat="Server">
    <link href="~/Guest/Gallery/css/visuallightbox.css" rel="stylesheet" type="text/css" />
    <link href="~/Guest/Gallery/css/vlightbox6.css" rel="stylesheet" type="text/css" />
    <script src="~/Guest/Gallery/js/visuallightbox.js" type="text/javascript"></script>
    <script src="~/Guest/Gallery/js/vlbdata6.js" type="text/javascript"></script>
    <script src="~/Guest/Gallery/js/jquery.min.js" type="text/javascript"></script>
    <link href="../App_Themes/Default/css/TableStyles.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function CheckName(sender, e) {
            var maxUplouder = document.getElementById("<%=MaxPicFileUpload.ClientID %>");
            var minUplouder = document.getElementById("<%=MinPicFileUpload.ClientID %>");
            if (maxUplouder != "") {
                var maxFilepath = maxUplouder.value;
                var maxFilename = maxFilepath.substring(maxFilepath.lastIndexOf('\\') + 1).toLowerCase();
                var minFilepath = minUplouder.value;
                var minFilename = minFilepath.substring(minFilepath.lastIndexOf('\\') + 1).toLowerCase();
                if (minFilename != maxFilename) {
                    alert("نام دو تصویر باید یکسان باشد");
                    e.IsValid = false;
                    return;
                }
            }
            e.IsValid = true;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Main_MainContentPlaceHolder" runat="Server">
    <div id="background-blue4">
        background
    </div>
    <div class="page">
        <div class="page4">
            <div class="sidebar">
                <a href="../Default.aspx" id="logo">
                    <img id="Img1" runat="server" src="~/App_Themes/Default/images/logo.png" alt="logo" /></a>
                <ul>
                    <li class="home">
                        <a id="default_a" href="~/Admin/Confirm.aspx" runat="server">آزمایشات تایید شده</a></li>

                    <li class="about">
                        <a id="testlist_a" href="~/Admin/CategoryItem.aspx" runat="server">گروه آزمایشات</a></li>

                    <li class="projects">
                        <a id="paper_a" href="#" runat="server">کاربری</a></li>
                    <li class="selected blog">
                        <a id="gallery_a" href="#" runat="server">مدیریت سایت</a></li>

                    <li class="contact">
                        <a id="logout_a" href="#" runat="server" onclick="if(!confirm('آیا قصد خروج از سیستم را دارید؟')) return false;" onserverclick="LogoutButton_Click">خروج از سیستم</a></li>
                </ul>
            </div>
            <div class="body">
                <div>
                    <table border="0" cellpadding="0" cellspacing="0" style="width: 500px">
                        <tr valign="middle">
                            <td style="width: 80px" align="right">تصویر کوچک:
                            </td>
                            <td style="width: 380px" align="right" dir="rtl">
                                <asp:FileUpload ID="MinPicFileUpload" runat="server" Width="350px" />
                                <asp:RequiredFieldValidator ID="MinRequiredFieldValidator" runat="server" ErrorMessage="*"
                                    ControlToValidate="MinPicFileUpload" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr valign="middle">
                            <td style="width: 80px" align="right">تصویر بزرگ:
                            </td>
                            <td style="width: 380px" align="right" dir="rtl">
                                <asp:FileUpload ID="MaxPicFileUpload" runat="server" Width="350px" />
                                <asp:RequiredFieldValidator ID="MaxRequiredFieldValidator" runat="server" ErrorMessage="*"
                                    ControlToValidate="MaxPicFileUpload" ValidationGroup="Insert"></asp:RequiredFieldValidator>
                            </td>
                        </tr>
                        <tr valign="middle">
                            <td style="width: 80px" align="right"></td>
                            <td style="width: 380px" align="right" dir="rtl">
                                <asp:CustomValidator ID="fileNameCustomValidator" ValidationGroup="Insert" ControlToValidate="MaxPicFileUpload"
                                    runat="server" ClientValidationFunction="CheckName" ErrorMessage="نام دو تصویر باید یکسان باشد"></asp:CustomValidator>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" align="left">
                                <table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
                                    <tr>
                                        <td style="height: 15px">&nbsp;
                                        </td>
                                        <td align="left" valign="top" style="width: 80px;"></td>
                                        <td align="left" valign="top" style="width: 80px;"></td>
                                    </tr>
                                    <tr>
                                        <td style="height: 15px">&nbsp;
                                        </td>
                                        <td align="left" valign="top" style="width: 80px;">
                                            <asp:ImageButton ID="InsertButton" runat="server" CommandName="Insert" SkinID="InsertButton"
                                                ValidationGroup="Insert" OnClick="InsertButton_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <br />
                    <asp:MultiView ID="ImageMultiView" runat="server">
                        <asp:View ID="NoFileView" runat="server">
                            <p>
                                تصویری در مسیر فایل های گالری وجود ندارد
                            </p>
                        </asp:View>
                        <asp:View ID="FileView" runat="server">
                            <div style="overflow: auto; width: 90%; height: 300px; border-left: 1px gray solid; border-bottom: 1px gray solid; padding: 0px; margin: 0px">
                                <asp:Table ID="ImageTable" runat="server">
                                </asp:Table>
                            </div>
                        </asp:View>
                    </asp:MultiView>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
